import mockRequest from '@/utils/mockRequest'

const actions = {
  // 获取mock数据
  async getDate ({ commit }) {
    let result = await mockRequest.get('/home/list')
    if (result.code === 20000) {
      commit('GETDATA', result.data)
    }
  }
}

const mutations = {
  GETDATA (state, data) {
    state.list = data
  }
}

const state = {}

export default {
  namespaced: true,
  actions,
  mutations,
  state
}
